﻿
@{
    ViewBag.Title = "QueryGoods";
    List<Yyyg.Models.Goods> queryList = ViewBag.QueryList;
    Layout = null;
}

<div class="page">

    @if (queryList.Count == 0)
    {
        <text>
            <div class="query-none fill flex-center">
                <span style="font-size:1.8rem;color:#666;">
                    没有查询到任何商品
                </span>
            </div>
        </text>
    }
    else
    {
        <table id="qres" border="0">
            <tr>
                <th>行号</th>
                <th>Guid</th>
                <th>标题</th>
                <th>价值</th>
                <th>夺宝人次</th>
                <th>分类</th>
                <th>库存</th>
                <th>简介</th>
                <th>已上架</th>
                <th>操作</th>
            </tr>
            @for (int i = 0; i < queryList.Count; i++)
            {
                var good = queryList[i];
                <tr id="tr-@good.Guid">
                    <td>@(i + 1)</td>
                    <td class="guid">@good.Guid</td>
                    <td>@good.Title</td>
                    <td>@good.Price</td>
                    <td>@good.Need_amo</td>
                    <td>@Yyyg.BLL.GoodsOper.QueryTypeName(good.Typeid)</td>
                    <td>@good.Stock</td>
                    <td>@good.Brin</td>
                    <td>@(good.Enable ? "上架中" : "已下架")</td>
                    <td>
                        <button class="btn-change">修改</button>
                        <button class="btn-del">删除</button>
                    </td>
                </tr>
            }
        </table>
    }
    <script type="text/javascript">
        $("#qres .btn-change").click(function () {
            var guid = $(this).parent().prevAll(".guid").text();
            showChange_Ifr(guid);
        });
        $("#qres .btn-del").click(function () {
            var guid = $(this).parent().prevAll(".guid").text();
            removeGood(guid);
        });
    </script>
</div>